{% extends "base.html" %}

{% block content %}

<div class="container my-4 p-4 bg-white rounded shadow">
    <!-- 标题 -->
    <h2 class="text-center mb-4 text-info">查看汉字信息</h2>

    <!-- 汉字九宫格 -->
    <div class="text-center mb-4">
        <div class="hanzi-square">
            <div class="line-horizontal"></div>
            <div class="line-vertical"></div>
            <span class="hanzi-char">{{ row['hanzi'] }}</span>
        </div>
    </div>

    <!-- 全码、拼音、Unicode码 网格布局 -->
    <div class="row text-center mb-4">
        <div class="col-md-4">
            <div class="p-3 border rounded bg-light">
                <h5 class="text-secondary fw-bold">全码</h5>
                <span class="text-primary fw-bold" style="font-size: 1.5rem;">{{ row['quanma'] }}</span>
            </div>
        </div>
        <div class="col-md-4">
            <div class="p-3 border rounded bg-light">
                <h5 class="text-secondary fw-bold">拼音</h5>
                <span class="text-dark">{{ row['pinyin'] }}</span>
            </div>
        </div>
        <div class="col-md-4">
            <div class="p-3 border rounded bg-light">
                <h5 class="text-secondary fw-bold">Unicode码</h5>
                <span class="text-dark">{{ row['hex'] }}</span>
            </div>
        </div>
    </div>

    <!-- 解释部分 -->
    <div class="row mb-4">
        <div class="col-md-12">
            <div class="p-3 border rounded bg-light">
                <h5 class="text-secondary fw-bold mb-2">解释</h5>
                <p class="text-dark fw-bold" style="font-size: 1.2rem; line-height: 1.6;">
                    {{ row['jieshi'] }}
                </p>
            </div>
        </div>
    </div>

    <!-- 第一码到末码紧凑布局 -->
    <div class="row text-center mb-4">
        <div class="col-3">
            <div class="p-2 bg-light border rounded">
                <h6 class="text-secondary fw-bold">第一码</h6>
                <span class="text-primary fw-bold">{{ row['yima'] }}</span>
            </div>
        </div>
        <div class="col-3">
            <div class="p-2 bg-light border rounded">
                <h6 class="text-secondary fw-bold">第二码</h6>
                <span class="text-primary fw-bold">{{ row['erma'] }}</span>
            </div>
        </div>
        <div class="col-3">
            <div class="p-2 bg-light border rounded">
                <h6 class="text-secondary fw-bold">倒数第二码</h6>
                <span class="text-primary fw-bold">{{ row['sanma'] }}</span>
            </div>
        </div>
        <div class="col-3">
            <div class="p-2 bg-light border rounded">
                <h6 class="text-secondary fw-bold">末码</h6>
                <span class="text-primary fw-bold">{{ row['sima'] }}</span>
            </div>
        </div>
    </div>

    <!-- 操作按钮 -->
    <div class="text-center mt-4">
        <a href="{{ url_for('edit', id=row['id']) }}" class="btn btn-primary px-4 me-2">编辑</a>
        <!-- <a href="{{ url_for('delete', id=row['id']) }}" class="btn btn-danger px-4">删除</a> -->
    </div>
</div>
{% endblock %}